home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / hplip / ui4 / printsettingsdialog.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2009-10-28  |  3KB  |  76 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. from base.g import *
  5. from base import device
  6. from prnt import cups
  7. from ui_utils import *
  8. from PyQt4.QtCore import *
  9. from PyQt4.QtGui import *
  10. from printsettingsdialog_base import Ui_Dialog
  11. from printsettingstoolbox import PrintSettingsToolbox
  12. from printernamecombobox import PRINTERNAMECOMBOBOX_TYPE_PRINTER_AND_FAX, PRINTERNAMECOMBOBOX_TYPE_FAX_ONLY
  13.  
  14. class PrintSettingsDialog(QDialog, Ui_Dialog):
  15.     
  16.     def __init__(self, parent, printer_name, fax_mode = False):
  17.         QDialog.__init__(self, parent)
  18.         self.setupUi(self)
  19.         self.fax_mode = fax_mode
  20.         self.printer_name = printer_name
  21.         self.device_uri = None
  22.         self.devices = { }
  23.         self.printer_index = { }
  24.         self.user_settings = UserSettings()
  25.         self.user_settings.load()
  26.         self.user_settings.debug()
  27.         self.initUi(printer_name)
  28.         QTimer.singleShot(0, self.updateUi)
  29.  
  30.     
  31.     def initUi(self, printer_name = None):
  32.         self.OptionsToolBox.include_print_options = False
  33.         if self.printer_name:
  34.             self.PrinterName.setInitialPrinter(self.printer_name)
  35.         
  36.         if self.fax_mode:
  37.             self.PrinterName.setType(PRINTERNAMECOMBOBOX_TYPE_FAX_ONLY)
  38.             self.TitleLabel.setText(self._PrintSettingsDialog__tr('Fax Settings'))
  39.         else:
  40.             self.PrinterName.setType(PRINTERNAMECOMBOBOX_TYPE_PRINTER_AND_FAX)
  41.         self.connect(self.CloseButton, SIGNAL('clicked()'), self.CloseButton_clicked)
  42.         self.connect(self.PrinterName, SIGNAL('PrinterNameComboBox_currentChanged'), self.PrinterNameComboBox_currentChanged)
  43.         self.connect(self.PrinterName, SIGNAL('PrinterNameComboBox_noPrinters'), self.PrinterNameComboBox_noPrinters)
  44.         self.setWindowIcon(QIcon(load_pixmap('hp_logo', '128x128')))
  45.  
  46.     
  47.     def updateUi(self):
  48.         self.PrinterName.updateUi()
  49.  
  50.     
  51.     def PrinterNameComboBox_noPrinters(self):
  52.         FailureUI(self, self._PrintSettingsDialog__tr('<b>No printers or faxes found.</b><p>Please setup a printer or fax and try again.'))
  53.         self.close()
  54.  
  55.     
  56.     def PrinterNameComboBox_currentChanged(self, device_uri, printer_name):
  57.         self.printer_name = printer_name
  58.         self.device_uri = device_uri
  59.         
  60.         try:
  61.             self.devices[device_uri]
  62.         except KeyError:
  63.             self.devices[device_uri] = device.Device(device_uri)
  64.  
  65.         self.OptionsToolBox.updateUi(self.devices[device_uri], self.printer_name)
  66.  
  67.     
  68.     def CloseButton_clicked(self):
  69.         self.close()
  70.  
  71.     
  72.     def __tr(self, s, c = None):
  73.         return qApp.translate('PrintSettingsDialog', s, c)
  74.  
  75.  
  76.